/**
 * 
 */
package com.orange.modules.dao.expert;

import java.sql.SQLException;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.orange.dbhelp.DbHelper;
import com.orange.modules.entity.expert.AuthObservationEvaluation;

/**
 * @author gaogs
 *
 * 2016-12-2
 */
@Repository
public class AuthObservationEvaluationRepository {

	@Resource(name = "dbHelper")
	private DbHelper dbHelper;
	
	@Autowired
	private AuthObservationEvaluationDao authObservationEvaluationDao;
	
	/**
	 * 保存专家课堂观摩填写信息
	 * @param a
	 */
	public void saveAuthObservationEvaluationInfo(AuthObservationEvaluation a){
		authObservationEvaluationDao.save(a);
	}
	
	/**
	 * 根据id查询课堂观摩信息
	 * @param pid
	 * @return
	 */
	public AuthObservationEvaluation queryAuthObservationEvaluationInfo(String pid){
		AuthObservationEvaluation a =authObservationEvaluationDao.findOne(pid);
		return a;
	}
	
	/**
	 * 查询专家课堂观摩信息
	 * @param schoolId
	 * @param expertId
	 * @return
	 * @throws SQLException
	 */
	public AuthObservationEvaluation queryAuthObservationEvaluationInfo(String schoolId,String expertId) throws SQLException{
		String sql="SELECT a.p_id as pid ,a.s_school_id as schoolId ,a.s_export_id as exportId ,a.s_name as name ," +
				" a.s_class_c as classC ,a.s_student_amount as studentAmount ," +
				" a.s_teacher as teacher ,a.s_title as title ,a.s_age as age ,a.s_class_catagory as classCatagory ," +
				" a.s_teaching_subject as techingSubject ," +
				" a.s_point_1 as point1 ,a.s_point_2 as point2 ,a.s_point_3 as point3 ,a.s_point_4 as point4 ," +
				" a.s_point_5 as point5 ,a.s_opinion as opinion ," +
				" a.s_comprehensive as comprehensive ,a.s_create_time as createTime " +
				" FROM t_auth_observation_evaluation as a WHERE a.s_school_id=? AND a.s_export_id=?";
		AuthObservationEvaluation s=dbHelper.getBean(sql, AuthObservationEvaluation.class, schoolId,expertId);
		return s;
	}
	
	
	
	
	
	
	
}
